package com.example.employee.mapper;

import com.example.employee.domain.po.Employee;
import com.example.employee.domain.vo.EmployeeInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface EmployeeMapper {

void update(Employee employee);

    Employee getEmployeeById(Long id);
    // 修改密码
    @Update("update employee set password = #{password},update_time = now() where id=#{id}")
    void updatePwd(@Param("password") String password, @Param("id") Long id);

    /**
     * 获取员工信息
     * @param userId
     * @return
     */
    @Select("select id,phone,gender,nickname,avatar,status,role from employee where id = #{userId}")
    EmployeeInfoVO selectEmployeeInfo(Long userId);
}
